/**
 * @author caesar
 * @date 2025/7/4
 * @apiNote
 */
/*### 求三角形面积
（1）声明TriangleCalculator两个重载方法
- 方法1：double area(double base, double height),根据底边和高，求三角形面积，
- 方法2：double area(double a, double b, double c),根据三条边，求三角形面积，根据三角形三边求面积的海伦公式

*/
public class TriangleCalculatortools {
    public static double area(double base, double height)
    {
        return base * height / 2;
    }
    public static double area(double a, double b, double c)
    {
        double p = (a + b + c) / 2;
        return Math.sqrt(p * (p - a) * (p - b) * (p - c));
    }
}
